<!--Copyright (C) Kherty.  All rights reserved.-->
<UserControl x:Class="OpenLS.Spreadsheet.UI.FormatControl"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:ssui="clr-namespace:OpenLS.Spreadsheet.UI" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:Internals="clr-namespace:OpenLS.Spreadsheet.UI.Internals"
             xmlns:Resources="clr-namespace:OpenLS.Spreadsheet.UI.Internals.Resources" Name="self">
    <Border BorderBrush="Black" BorderThickness="1" Background="Beige" CornerRadius="18">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.Resources>

        </Grid.Resources>
        <TextBlock Text="{x:Static Resources:UIStringTable.Category__}"/>
        <ListBox Name="cat" Grid.Row="1" Margin="0 0 3 0" ItemsSource="{Binding Source={x:Static Internals:FormatCategory.AllCategories}}" IsSynchronizedWithCurrentItem="true">
            <ListBox.ItemTemplate>
                <HierarchicalDataTemplate DataType="{x:Type Internals:FormatCategory}">
                    <TextBlock Text="{Binding CategoryName}"/>
                </HierarchicalDataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        <ListBox Grid.Column="1" Grid.Row="1" Margin="3 0 0 0" ItemsSource="{Binding ElementName=cat, Path=SelectedItem.Formats}" SelectionChanged="OnFormatChanged" IsSynchronizedWithCurrentItem="True">
            <ListBox.ItemTemplate>
                <HierarchicalDataTemplate>
                    <TextBlock Text ="{Binding FormatName}"/>
                </HierarchicalDataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>


    </Grid>
    </Border>
</UserControl>
